package com.chixing.day12_date_factory;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public class DateUtilTest {
    public static void main(String[] args) {
        String str1 = "2021-02-02";
        System.out.println(DateUtil.stringToLocalDate(str1));
        String str2 = "11:27:21";
        System.out.println(DateUtil.stringToLocalTime(str2));
        String str3 = "2021-02-02 11:27:24";
        System.out.println(DateUtil.stringToLocalDateTime(str3));

        LocalDateTime localDateTime1 = LocalDateTime.now();
        System.out.println(DateUtil.localDateTimeToString(localDateTime1));
        LocalDate localDate1 = LocalDate.now();
        System.out.println(DateUtil.localDateToString(localDate1));
        LocalTime localTime1 = LocalTime.now();
        System.out.println(DateUtil.localTimeToString(localTime1));
    }
}
